//2009/08/22 13:03:06
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class Chessboard
{// Use '8' to chanllenge.
public:
    string changeNotation(string cell)
    {
		if(isalpha(cell[0]) || isalpha(cell[1]))
			return pos2num(cell);
		else 
			return num2pos(cell);
    }
private:
    string num2pos(string cell)
    {
        stringstream s(cell);
        int num;
        s >> num;
        string str;
        str += 'a' + (num % 8 + 7) % 8;
        str += '1' + (int)((num - (num % 8 + 7) % 8) / 8);
        return str;
    }
	string pos2num(string cell)
	{
		int num = 0;
		num += (cell[0] - 'a' + 1) + (cell[1] - '0' - 1) * 8;
		stringstream s;
		s << num;
		return s.str();
	}
};
